package basic_1002;

//import java.util.ArrayList;
//import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		
		int N=scanner.nextInt();

		int A1=0;
		int A2=0; int A2_flag=0;
		int A3=0;
		int A4_sum=0;int A4_num=0;
		int A5=0;
		
		for(int i=0;i<N;i++) {
			int num=scanner.nextInt();
			
			switch(num%5) {
			case 0:
				if(num%2==0) {
					A1+=num;
				}
				break;
			case 1:
				if(A2_flag==0) {
					A2_flag=1;
				}
				A2+=num*A2_flag;
				A2_flag*=-1;
				break;
			case 2:
				A3++;
				break;
			case 3:
				A4_sum+=num;
				A4_num++;
				break;
			case 4:
				if(num>=A5) {
					A5=num;
				}
				break;
			}
		}
		scanner.close();
		
		String o1= A1==0	? "N":""+A1;
		String o2= A2_flag==0 ? "N":""+A2;
		String o3=A3==0?"N":""+A3;
		String o4=A4_num==0?"N":String.format("%.1f",A4_sum*1.0f/A4_num); 
		String o5=A5==0?"N":""+A5;

		System.out.print(o1+" "+o2+" "+o3+" "+o4+" "+o5);
	}
}
